package com.engine4cloud.tdf.supervision.convert;

import com.engine4cloud.tdf.supervision.dto.result.JzdxJudgmentResultDTO;
import com.engine4cloud.tdf.supervision.dto.create.TerminalBaseInfoCreateDTO;
import com.engine4cloud.tdf.supervision.entity.JzdxJudgmentEntity;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

@Mapper
public interface JzdxTerminalJudgmentConvert {
    JzdxTerminalJudgmentConvert INSTANCE = Mappers.getMapper(JzdxTerminalJudgmentConvert.class);

    JzdxJudgmentEntity createTo(TerminalBaseInfoCreateDTO s);

    default JzdxJudgmentEntity create(TerminalBaseInfoCreateDTO s, String code, Long tenantId) {
        JzdxJudgmentEntity entity = createTo(s);
        entity.setRybh(code);
        entity.setTenantId(tenantId);
        return entity;
    }

    JzdxJudgmentEntity convert(JzdxJudgmentResultDTO dto);
}

